<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('phone')->unique('phone');
            $table->string('email')->unique('email');
            $table->string('password');
            $table->string('nickname');
            $table->string('role_ids');
            $table->string('avatar'); // 头像
            $table->string('intro'); // 简介
            $table->timestamp('last_login_at'); // 最后登录时间
            $table->timestamp('last_active_at'); // 最后活跃时间
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
